(function initLocalClocks() {
    _getLocalTime()
})()

function _getLocalTime() {
    // get local time
    var date = new Date
    var seconds = date.getSeconds()
    var minutes = date.getMinutes()
    var hours = date.getHours()

    var hands = [
        {
            hand: 'hours',
            angle: (hours * 30) + (minutes / 2)
        },
        {
            hand: 'minutes',
            angle: (minutes * 6)
        },
        {
            hand: 'seconds',
            angle: (seconds * 6)
        }
    ]
    // get hands html<div></div> elements
    let elements = []
    hands.forEach((elem) => {
        elements.push(document.querySelector('.' + elem.hand))
    })
    // set angle
    elements = elements.map((item, index) => {
        item.style.webkitTransform = 'rotateZ(' + hands[index].angle + 'deg)'
        item.style.transform = 'rotateZ(' + hands[index].angle + 'deg)';
        console.log('item: ', item);
        return item
    })
}